package com.alvin.springshiro;

import lombok.extern.log4j.Log4j2;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@MapperScan("com.alvin.springshiro.dao")
@Log4j2
//@EnableDiscoveryClient
//@EnableTransactionManagement
@EnableScheduling
@EnableAsync
public class SpringShiroApplication {

    @EventListener(ContextClosedEvent.class)
    public void ContextClose(ContextClosedEvent event){
        log.info(event.toString());
        log.info("系统关闭了");
    }

    public static void main(String[] args) {
        SpringApplication.run(SpringShiroApplication.class, args).registerShutdownHook();
    }
}
